package Day1;

import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改
/**
 * 2020JavaB真题:单词分析
 * https://www.lanqiao.cn/problems/504/learning/?problem_list_id=2&page=1&tags=2020&tag_relation=union
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        String s = scan.next();
        int ch = 0 , max = 0;
        int[] arr = new int[30];
        for(int i = 0; i < s.length(); i++){
          arr[s.charAt(i) - 'a']++;
        }

        for(int j = 0; j < 26; j++){
          if(max < arr[j]){
            ch = j;
            max = arr[j];
          }
        }

        System.out.println((char) (ch + 'a'));
        System.out.println(max);
        scan.close();
    }
}